// ==========================================================================
// GFast自动生成service操作代码。
// 生成日期：2024-01-05 17:57:11
// 生成路径: internal/app/flow/service/flow_model.go
// 生成人：gfast
// desc:流程模型
// company:云南奇讯科技有限公司
// ==========================================================================

package service

import (
	"context"

	"github.com/gogf/gf/v2/net/ghttp"
	"github.com/tiger1103/gfast/v3/internal/app/flow/model"
)

type IFlowModel interface {
	List(ctx context.Context, req *model.FlowModelSearchReq) (res *model.FlowModelSearchRes, err error)
	GetExportData(ctx context.Context, req *model.FlowModelSearchReq) (listRes []*model.FlowModelInfoRes, err error)
	Import(ctx context.Context, file *ghttp.UploadFile) (err error)
	GetById(ctx context.Context, Id uint64) (res *model.FlowModelInfoRes, err error)
	Add(ctx context.Context, req *model.FlowModelAddReq) (err error)
	Edit(ctx context.Context, req *model.FlowModelEditReq) (err error)
	Delete(ctx context.Context, Id []uint64) (err error)
	LinkedFlowModelDataSearch(ctx context.Context) (res *model.LinkedFlowModelDataSearchRes, err error)
	SaveNodeInfo(ctx context.Context, modelId uint64, nodes []*model.FlowModelNodeAddReq, edges []*model.FlowNodeLineAddReq) (err error)
	GetNodeInfo(ctx context.Context, modelId uint64) (nodeInfo *model.NodeInfoRes, err error)
}

var localFlowModel IFlowModel

func FlowModel() IFlowModel {
	if localFlowModel == nil {
		panic("implement not found for interface IFlowModel, forgot register?")
	}
	return localFlowModel
}

func RegisterFlowModel(i IFlowModel) {
	localFlowModel = i
}
